#!/usr/bin/python3
# ******************************************************************************
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
# licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#     http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
# PURPOSE.
# See the Mulan PSL v2 for more details.
# ******************************************************************************/

import os

# obs工程工程本地路径
PROJECT_WORK_DIR = "~/obs-project-workspace"

# 过程中各检查项数据记录文件
RECORDS_COURSE = os.path.join(PROJECT_WORK_DIR, "records-course")

# http请求时最大的重试次数
STOP_MAX_ATTEMPT_NUMBER = 3

# 重试过程中等待的间隔
WAIT_FIXED = 2

BUILD_INSTALL_STAGE = [
    "single_build_check",
    "single_install_check",
    "compare_check",
    "multi_build_check",
    "multi_install_check",
]

GITEE_BRANCH_PROJECT_MAPPING = {
    "master": [
        "openEuler:Mainline",
        "openEuler:Epol",
        "openEuler:Factory",
        "bringInRely",
        "openEuler:Extras",
    ],
    "openEuler-20.03-LTS": ["openEuler:20.03:LTS"],
    "openEuler-20.03-LTS-Next": [
        "openEuler:20.03:LTS:Next",
        "openEuler:20.03:LTS:Next:Epol",
    ],
    "openEuler-EPOL-LTS": ["bringInRely"],
    "openEuler-20.09": [
        "openEuler:20.09",
        "openEuler:20.09:Epol",
        "openEuler:20.09:Extras",
    ],
    "mkopeneuler-20.03": ["openEuler:Extras"],
    "openEuler-20.03-LTS-SP1": [
        "openEuler:20.03:LTS:SP1",
        "openEuler:20.03:LTS:SP1:Epol",
        "openEuler:20.03:LTS:SP1:Extras",
    ],
    "openEuler-20.03-LTS-SP2": [
        "openEuler:20.03:LTS:SP2",
        "openEuler:20.03:LTS:SP2:Epol",
        "openEuler:20.03:LTS:SP2:Extras",
    ],
    "openEuler-21.03": [
        "openEuler:21.03",
        "openEuler:21.03:Epol",
        "openEuler:21.03:Extras",
    ],
    "openEuler-21.09": [
        "openEuler:21.09",
        "openEuler:21.09:Epol",
        "openEuler:21.09:Extras",
    ],
    "openEuler-20.03-LTS-SP3": [
        "openEuler:20.03:LTS:SP3",
        "openEuler:20.03:LTS:SP3:Epol",
    ],
    "openEuler-22.03-LTS-Next": [
        "openEuler:22.03:LTS:Next",
        "openEuler:22.03:LTS:Next:Epol",
    ],
    "openEuler-22.03-LTS": ["openEuler:22.03:LTS", "openEuler:22.03:LTS:Epol"],
    "oepkg_openstack-train_oe-20.03-LTS-SP1": [
        "openEuler:20.03:LTS:SP1:oepkg:openstack:train",
        "openEuler:20.03:LTS:SP1",
        "openEuler:20.03:LTS:SP1:Epol",
    ],
    "oepkg_openstack-common_oe-20.03-LTS-SP2": [
        "openEuler:20.03:LTS:SP2:oepkg:openstack:common",
        "openEuler:20.03:LTS:SP2",
    ],
    "oepkg_openstack-queens_oe-20.03-LTS-SP2": [
        "openEuler:20.03:LTS:SP2:oepkg:openstack:queens",
        "openEuler:20.03:LTS:SP2:oepkg:openstack:common",
        "openEuler:20.03:LTS:SP2",
    ],
    "oepkg_openstack-rocky_oe-20.03-LTS-SP2": [
        "openEuler:20.03:LTS:SP2:oepkg:openstack:rocky",
        "openEuler:20.03:LTS:SP2:oepkg:openstack:common",
        "openEuler:20.03:LTS:SP2",
    ],
    "oepkg_openstack-common_oe-20.03-LTS-Next": [
        "openEuler:20.03:LTS:Next:oepkg:openstack:common",
        "openEuler:20.03:LTS:Next",
    ],
    "oepkg_openstack-queens_oe-20.03-LTS-Next": [
        "openEuler:20.03:LTS:Next:oepkg:openstack:queens",
        "openEuler:20.03:LTS:Next:oepkg:openstack:common",
        "openEuler:20.03:LTS:Next",
    ],
    "oepkg_openstack-rocky_oe-20.03-LTS-Next": [
        "openEuler:20.03:LTS:Next:oepkg:openstack:rocky",
        "openEuler:20.03:LTS:Next:oepkg:openstack:common",
        "openEuler:20.03:LTS:Next",
    ],
    "oepkg_openstack-common_oe-20.03-LTS-SP3": [
        "openEuler:20.03:LTS:SP3:oepkg:openstack:common",
        "openEuler:20.03:LTS:SP3",
    ],
    "oepkg_openstack-queens_oe-20.03-LTS-SP3": [
        "openEuler:20.03:LTS:SP3:oepkg:openstack:queens",
        "openEuler:20.03:LTS:SP3:oepkg:openstack:common",
        "openEuler:20.03:LTS:SP3",
    ],
    "oepkg_openstack-rocky_oe-20.03-LTS-SP3": [
        "openEuler:20.03:LTS:SP3:oepkg:openstack:rocky",
        "openEuler:20.03:LTS:SP3:oepkg:openstack:common",
        "openEuler:20.03:LTS:SP3",
    ],
    "Multi-Version_OpenStack-Train_openEuler-22.03-LTS-Next": [
        "openEuler:22.03:LTS:Next:Epol:Multi-Version:OpenStack:Train",
        "openEuler:22.03:LTS:Next",
        "openEuler:22.03:LTS:Next:Epol",
    ],
    "Multi-Version_OpenStack-Wallaby_openEuler-22.03-LTS-Next": [
        "openEuler:22.03:LTS:Next:Epol:Multi-Version:OpenStack:Wallaby",
        "openEuler:22.03:LTS:Next",
        "openEuler:22.03:LTS:Next:Epol",
    ],
    "Multi-Version_OpenStack-Train_openEuler-22.03-LTS": [
        "openEuler:22.03:LTS:Epol:Multi-Version:OpenStack:Train",
        "openEuler:22.03:LTS",
        "openEuler:22.03:LTS:Epol",
    ],
    "Multi-Version_OpenStack-Wallaby_openEuler-22.03-LTS": [
        "openEuler:22.03:LTS:Epol:Multi-Version:OpenStack:Wallaby",
        "openEuler:22.03:LTS",
        "openEuler:22.03:LTS:Epol",
    ],
    "openEuler-22.03-LTS-LoongArch": [
        "openEuler:22.03:LTS:LoongArch",
        "openEuler:22.03:LTS",
        "openEuler:22.03:LTS:Epol",
    ],
}


# 通过osc下载的rpm包保存的位置
DOWNLOAD_RPM_DIR = os.path.join(PROJECT_WORK_DIR, "rpms")
